package com.cn.jinl.domain;

import com.cn.jinl.utils.CommonUtil;
import com.google.common.collect.ImmutableMap;
import org.apache.commons.lang3.StringUtils;

import java.util.Date;
import java.util.List;
import java.util.Map;

public class LinePei {
    private String id;

    private String deviceCode;

    private String gpName;

    private String zlValue;

    private String flValue;

    private String smValue;

    private String ratios;

    private String totalValue;

    private String plUserName;

    private String plUserId;

    private String plStatus;

    private Date createTime;

    private Date updateTime;

    private String status;

    private String whiteDay;

    private String dutyDay;

    private String oldId;

    private String banTimePeriod;
    private String banTimeCount;
    private String unOutValue;

    private List<LinePeiAttr> linePeiAttrs;

    private List<LinePeiBan> linePeiBans;

    private List<LinePeiOut> linePeiOuts;



    private String startTime;

    private String endTime;

    private String collectTime;

    private String timeTarget;

    private String remark;

    private String banUserName;

    private int machineCount;
    private int count;


    public static final transient Map<String, String> STATUSMAP =
            ImmutableMap.of("0", "空置", "1", "拌料中","2","拌料异常","3","待出料","4","完成");


    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id == null ? null : id.trim();
    }

    public String getDeviceCode() {
        return deviceCode;
    }

    public void setDeviceCode(String deviceCode) {
        this.deviceCode = deviceCode == null ? null : deviceCode.trim();
    }

    public String getGpName() {
        return gpName;
    }

    public void setGpName(String gpName) {
        this.gpName = gpName == null ? null : gpName.trim();
    }

    public String getZlValue() {
        return zlValue;
    }

    public void setZlValue(String zlValue) {
        this.zlValue = zlValue == null ? null : zlValue.trim();
    }

    public String getFlValue() {
        return flValue;
    }

    public void setFlValue(String flValue) {
        this.flValue = flValue == null ? null : flValue.trim();
    }

    public String getSmValue() {
        return smValue;
    }

    public void setSmValue(String smValue) {
        this.smValue = smValue == null ? null : smValue.trim();
    }

    public String getRatios() {
        return ratios;
    }

    public void setRatios(String ratios) {
        this.ratios = ratios == null ? null : ratios.trim();
    }

    public String getTotalValue() {
        return totalValue;
    }

    public void setTotalValue(String totalValue) {
        this.totalValue = totalValue == null ? null : totalValue.trim();
    }

    public String getPlUserName() {
        return plUserName;
    }

    public void setPlUserName(String plUserName) {
        this.plUserName = plUserName == null ? null : plUserName.trim();
    }

    public String getPlUserId() {
        return plUserId;
    }

    public void setPlUserId(String plUserId) {
        this.plUserId = plUserId == null ? null : plUserId.trim();
    }

    public String getPlStatusCn() {
        return STATUSMAP.get(getPlStatus());
    }
    public String getPlStatus() {
        return plStatus;
    }

    public void setPlStatus(String plStatus) {
        this.plStatus = plStatus == null ? null : plStatus.trim();
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status == null ? null : status.trim();
    }

    public String getWhiteDay() {
        return whiteDay;
    }

    public void setWhiteDay(String whiteDay) {
        this.whiteDay = whiteDay == null ? null : whiteDay.trim();
    }

    public String getDutyDay() {
        return dutyDay;
    }

    public void setDutyDay(String dutyDay) {
        this.dutyDay = dutyDay == null ? null : dutyDay.trim();
    }

    public List<LinePeiAttr> getLinePeiAttrs() {
        return linePeiAttrs;
    }

    public void setLinePeiAttrs(List<LinePeiAttr> linePeiAttrs) {
        this.linePeiAttrs = linePeiAttrs;
    }

    public List<LinePeiBan> getLinePeiBans() {
        return linePeiBans;
    }

    public void setLinePeiBans(List<LinePeiBan> linePeiBans) {
        this.linePeiBans = linePeiBans;
    }

    public List<LinePeiOut> getLinePeiOuts() {
        return linePeiOuts;
    }

    public void setLinePeiOuts(List<LinePeiOut> linePeiOuts) {
        this.linePeiOuts = linePeiOuts;
    }

    public String getBanTimePeriod() {
        return banTimePeriod;
    }

    public void setBanTimePeriod(String banTimePeriod) {
        this.banTimePeriod = banTimePeriod;
    }

    public String getBanTimeCount() {
        return banTimeCount;
    }

    public void setBanTimeCount(String banTimeCount) {
        this.banTimeCount = banTimeCount;
    }

    public String getUnOutValue() {
        return unOutValue;
    }

    public void setUnOutValue(String unOutValue) {
        this.unOutValue = unOutValue;
    }

    public String getStartTime() {
        return startTime;
    }

    public void setStartTime(String startTime) {
        this.startTime = startTime;
    }

    public String getEndTime() {
        return endTime;
    }

    public void setEndTime(String endTime) {
        this.endTime = endTime;
    }

    public String getCollectTime() {
        return collectTime;
    }

    public void setCollectTime(String collectTime) {
        this.collectTime = collectTime;
    }

    public String getTimeTarget() {
        return timeTarget;
    }

    public void setTimeTarget(String timeTarget) {
        this.timeTarget = timeTarget;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public String getBanUserName() {
        return banUserName;
    }

    public void setBanUserName(String banUserName) {
        this.banUserName = banUserName;
    }

    public int getMachineCount() {
        return machineCount;
    }

    public void setMachineCount(int machineCount) {
        this.machineCount = machineCount;
    }

    public int getCount() {
        return count;
    }

    public void setCount(int count) {
        this.count = count;
    }


    public String getShowStartTime() {
        if(StringUtils.isNotEmpty(getStartTime())){
            return getStartTime().split(" ")[1];
        }
        return startTime;
    }

    public String getShowEndTime() {
        if(StringUtils.isNotEmpty(getEndTime())){
            return getEndTime().split(" ")[1];
        }
        return endTime;
    }

    public String getOldId() {
        return oldId;
    }

    public void setOldId(String oldId) {
        this.oldId = oldId;
    }

    public String getCreateTimeFt(){
        String formatTime = CommonUtil.getStrTime(getCreateTime(),"yyyy-MM-dd");
        return formatTime;
    }
}